<!-- eslint-disable vue/multi-word-component-names -->
<template>
    <div class="navbar">
        <div
            style="display: flex; justify-content: space-between; padding: 10px; background-color: #f2f2f2; border-radius: 5px;">
            <button> <a href="https://www.bilibili.com/video/BV14m411C7Yo/" target="_blank"
                    style="color: lightpink; text-decoration: none; font-weight: bold;">B站视频地址</a> </button>
            <button> <a href="https://gitee.com/gao-weikeng/website" target="_blank"
                    style="color: lightblue; text-decoration: none; font-weight: bold;">代码仓库地址</a> </button>


            <el-button type="primary" style="background-color: #4CAF50; color: white; border-color: #4CAF50;">
                <RouterLink to="/VideoPlayer" style="color: white; text-decoration: none;">小组分工</RouterLink>
            </el-button>
        </div>

        <div class="navbar-icon" @mouseenter="showDropdown = true" @mouseleave="showDropdown = false">
            <img src="https://codelover.club/files/stutasks/userID_899/currNo_43/666/Fsn2fPxwf1iL_gVzyZta1kghX8cr.jpg"
                alt="Navbar Icon" width="60" height="60" style="margin-right: 70px">
            <div class="dropdown" v-if="showDropdown">
                <div class="dropdown-item">
                    <div class="dropdown-content">
                        <div class="dropdown-info">
                            <img src="https://codelover.club/files/stutasks/userID_899/currNo_43/666/Fsn2fPxwf1iL_gVzyZta1kghX8cr.jpg"
                                alt="Navbar Icon" width="120" height="120">
                            <div>
                                <div class="dropdown-name">
                                    <h3>2200xxxxxx</h3>
                                    <router-link to="/home" class="navbar-link">个人主页</router-link>
                                </div>
                                <div class="dropdown-role">
                                    大学生
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="dropdown-links">
                        <router-link to="/home" class="navbar-link">
                            <img src="https://codelover.club/files/stutasks/userID_899/currNo_43/666/Fsn2fPxwf1iL_gVzyZta1kghX8cr.jpg"
                                alt="Countdown Icon" width="20" height="20">
                            我的课程
                        </router-link>
                        <router-link to="/home" class="navbar-link">
                            <img src="https://codelover.club/files/stutasks/userID_899/currNo_43/666/Fsn2fPxwf1iL_gVzyZta1kghX8cr.jpg"
                                alt="Countdown Icon" width="20" height="20">
                            学习广场
                        </router-link>
                    </div>
                    <div class="dropdown-links">
                        <router-link to="/home" class="navbar-link">
                            <img src="https://codelover.club/files/stutasks/userID_899/currNo_43/666/Fsn2fPxwf1iL_gVzyZta1kghX8cr.jpg"
                                alt="Countdown Icon" width="20" height="20">
                            管理中心
                        </router-link>
                    </div>
                </div>
                <div class="dropdown-item">
                    <div class="dropdown-title">
                        <img src="https://codelover.club/files/stutasks/userID_899/currNo_43/666/Fsn2fPxwf1iL_gVzyZta1kghX8cr.jpg"
                            alt="Countdown Icon" width="20" height="20">
                        22级网页设计技术V3
                    </div>
                    <div class="dropdown-links">
                        <router-link to="/coursedetail" class="dropdown-link">继续学习</router-link>
                    </div>
                </div>
                <div class="dropdown-item">
                    <div class="dropdown-title">
                        <img src="https://codelover.club/files/stutasks/userID_899/currNo_43/666/Fsn2fPxwf1iL_gVzyZta1kghX8cr.jpg"
                            alt="Countdown Icon" width="20" height="20">
                        跨平台APP项目开发
                    </div>
                    <div class="dropdown-links">
                        <router-link to="/coursedetail" class="dropdown-link">继续学习</router-link>
                    </div>
                </div>
                <div class="dropdown-item">
                    <div class="dropdown-title">
                        <img src="https://codelover.club/files/stutasks/userID_899/currNo_43/666/Fsn2fPxwf1iL_gVzyZta1kghX8cr.jpg"
                            alt="Countdown Icon" width="20" height="20">
                        考试专用
                    </div>
                    <div class="dropdown-links">
                        <router-link to="/coursedetail" class="dropdown-link">继续学习</router-link>
                    </div>
                </div>
                <div class="dropdown-item">
                    <div class="dropdown-title">
                        <img src="https://codelover.club/files/stutasks/userID_899/currNo_43/666/Fsn2fPxwf1iL_gVzyZta1kghX8cr.jpg"
                            alt="Countdown Icon" width="20" height="20">
                        前端框架应用项目开发
                    </div>
                    <div class="dropdown-links">
                        <router-link to="/coursedetail" class="dropdown-link">继续学习</router-link>
                    </div>
                    <div class="out">
                        <RouterLink to="/">退出登录</RouterLink>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
import { RouterLink, RouterView } from 'vue-router';
export default {
    data() {
        return {
            showDropdown: false
        }
    },

}
</script>

<style scoped>
.navbar {
    left: 0;
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    height: 60px;
    background-color: #f2f2f2;
    z-index: 999;
}

.navbar-icon {
    position: relative;
    cursor: pointer;
}

.dropdown {
    position: absolute;
    top: 60px;
    right: 0;
    width: 270px;
    background-color: #f0f8ff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 20px;
    border-radius: 8px;
    z-index: 1000;
}

.dropdown-item {
    margin-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 20px;
}

.dropdown-content {
    display: flex;
    align-items: center;
}

.dropdown-info {
    display: flex;
}

.dropdown-info img {
    margin-right: 10px;
    border-radius: 50%;
}

.dropdown-name {
    display: flex;
    flex-direction: column;
}

.dropdown-name h3 {
    color: #333;
}

.dropdown-role {
    margin-top: 10px;
    color: #666;
}

.dropdown-links {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

.dropdown-links .navbar-link {
    margin-bottom: 0;
}

.dropdown-link {
    text-decoration: none;
    color: #007bff;
    margin-bottom: 5px;
}

.dropdown-link:hover {
    color: #0056b3;
}

.out {
    text-align: center;
}

.nav-item {
    /* 样式设置，比如边框、背景色、鼠标悬停效果等 */
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* 其他你想要的样式 */
}

.nav-item:hover {
    /* 鼠标悬停时的样式 */
    background-color: #f5f5f5;
    /* 示例 */
}

.close-btn {
    /* 关闭按钮的样式 */
    margin-left: 10px;
    /* 或者其他合适的间距 */
    /* 其他你想要的样式 */
    background-color: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 14px;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #333;
}

.hidden {
    /* 隐藏元素的样式 */
    display: none;
}
</style>
